Context / Client / update_change_set

update_change_set

Context.Client.update_change_set(**kwargs)

Drops operations from a change set that is held for curator review. Returns the updated change set.

See also: AWS API Documentation

Request Syntax

response = client.update_change_set(
    changeSetId='string',
    agentContextId='string',
    changeSetVersion=123,
    clientToken='string',
    operationsToRemove=[
        {
            'put': {
                'entity': {
                    'nodeId': 'string',
                    'edgeId': {
                        'from': 'string',
                        'to': 'string'
                    }
                },
                'properties': {
                    'string': {
                        'stringValue': 'string',
                        'intValue': 123,
                        'longValue': 123,
                        'boolValue': True|False,
                        'floatValue': ...,
                        'doubleValue': 123.0,
                        'stringListValue': [
                            'string',
                        ],
                        'intListValue': [
                            123,
                        ],
                        'longListValue': [
                            123,
                        ],
                        'floatListValue': [
                            ...,
                        ],
                        'doubleListValue': [
                            123.0,
                        ],
                        'boolListValue': [
                            True|False,
                        ]
                    }
                }
            },
            'update': {
                'entity': {
                    'nodeId': 'string',
                    'edgeId': {
                        'from': 'string',
                        'to': 'string'
                    }
                },
                'properties': {
                    'string': {
                        'stringValue': 'string',
                        'intValue': 123,
                        'longValue': 123,
                        'boolValue': True|False,
                        'floatValue': ...,
                        'doubleValue': 123.0,
                        'stringListValue': [
                            'string',
                        ],
                        'intListValue': [
                            123,
                        ],
                        'longListValue': [
                            123,
                        ],
                        'floatListValue': [
                            ...,
                        ],
                        'doubleListValue': [
                            123.0,
                        ],
                        'boolListValue': [
                            True|False,
                        ]
                    }
                }
            },
            'delete': {
                'entity': {
                    'nodeId': 'string',
                    'edgeId': {
                        'from': 'string',
                        'to': 'string'
                    }
                },
                'properties': {
                    'string': {
                        'stringValue': 'string',
                        'intValue': 123,
                        'longValue': 123,
                        'boolValue': True|False,
                        'floatValue': ...,
                        'doubleValue': 123.0,
                        'stringListValue': [
                            'string',
                        ],
                        'intListValue': [
                            123,
                        ],
                        'longListValue': [
                            123,
                        ],
                        'floatListValue': [
                            ...,
                        ],
                        'doubleListValue': [
                            123.0,
                        ],
                        'boolListValue': [
                            True|False,
                        ]
                    }
                }
            }
        },
    ]
)
Parameters:
  • changeSetId (string) –

    [REQUIRED]

    The change set to edit: the changeSetId that GetCurationProposal returns.

  • agentContextId (string) –

    [REQUIRED]

    The agent context that the change set belongs to, by its ID or ARN. AWS Context authorizes the request on this agent context’s ARN. If the change set belongs to another agent context, the request fails with ResourceNotFoundException.

  • changeSetVersion (integer) –

    [REQUIRED]

    The change set version that you read with GetChangeSet. The edit applies only if it’s still the latest version. Otherwise, the request fails with ConflictException.

  • clientToken (string) –

    A unique, case-sensitive identifier that you provide to make the request idempotent. For 8 hours, a retry of the same request with the same token returns the change set’s latest version without writing again, and the same token used for another change set or a different request returns a ValidationException.

    This field is autopopulated if not provided.

  • operationsToRemove (list) –

    [REQUIRED]

    Operations to remove, copied unchanged from ListChangeSetOperations. A retry must resend the same list with the same clientToken.

    • (dict) –

      One operation of a change set. Exactly one member is set. CreateChangeSet takes it as the operation to write, ListChangeSetOperations returns it, and UpdateChangeSet takes it to name an operation to remove. Operation values are customer content. A member set beside an unknown one is used and the unknown one is ignored, as an authorization member is ignored. An item with no member set, or two, is refused with ValidationException. A client built from an older model receives a member it does not know as an unknown member.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: put, update, delete.

      • put (dict) –

        Writes a node or edge in full. Creates it if it does not exist.

        • entity (dict) –

          Names the edge to write in entity.edgeId. Required for an edge. Omit it to write a node: a node’s ID comes from its properties, so AWS Context ignores entity.nodeId. ListChangeSetOperations returns a node put’s entity.nodeId as a placeholder of the form ~operations/<index>, which isn’t the node’s ID in the agent context.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: nodeId, edgeId.

          • nodeId (string) –

            The ID of the node. For an ontology schema node, use its iri: reference, which every write accepts.

          • edgeId (dict) –

            The edge, identified by the IDs of its start and end nodes. The edge type is in properties.edgeType.

            • from (string) – [REQUIRED]

              The ID of the node where the edge starts.

            • to (string) – [REQUIRED]

              The ID of the node where the edge ends.

        • properties (dict) – [REQUIRED]

          Up to 50 properties. {} when there are none. A node requires nodeType. An edge requires edgeType. ListChangeSetOperations returns the operation’s properties as stored, plus edgeType on an edge and the recorded nodeType / nodeName on a node (a written nodeType, or a name under nodeName, name, title or displayName, wins), in key order after those. AWS Context doesn’t list stored keys that aren’t customer content ( aws:*, ~*, and an edge’s identity keys), or a property cut by the 50-entry cap. UpdateChangeSet cannot remove such an item.

          • (string) –

            • (dict) –

              The value of a property on a node or an edge in an agent context. Exactly one member is set, and the member that is set determines the value’s type.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: stringValue, intValue, longValue, boolValue, floatValue, doubleValue, stringListValue, intListValue, longListValue, floatListValue, doubleListValue, boolListValue.

              • stringValue (string) –

                A string value, up to 2,048 characters.

              • intValue (integer) –

                A 32-bit signed integer value.

              • longValue (integer) –

                A 64-bit signed integer value.

              • boolValue (boolean) –

                A Boolean value.

              • floatValue (float) –

                A single-precision (32-bit) floating-point value.

              • doubleValue (float) –

                A double-precision (64-bit) floating-point value.

              • stringListValue (list) –

                A list of up to 1,000 string values, each up to 2,048 characters.

                • (string) –

              • intListValue (list) –

                A list of up to 1,000 32-bit signed integer values.

                • (integer) –

              • longListValue (list) –

                A list of up to 1,000 64-bit signed integer values.

                • (integer) –

              • floatListValue (list) –

                A list of up to 1,000 single-precision (32-bit) floating-point values.

                • (float) –

              • doubleListValue (list) –

                A list of up to 1,000 double-precision (64-bit) floating-point values.

                • (float) –

              • boolListValue (list) –

                A list of up to 1,000 Boolean values.

                • (boolean) –

      • update (dict) –

        Changes the properties of a node or edge. Like put, it creates a node that doesn’t exist, and every reader of the agent context can read the node unless the request specifies accessControlConfig.

        • entity (dict) – [REQUIRED]

          The node or edge to change. A node’s ID is built from its nodeType and identity properties, so entity.nodeId is a placeholder that must differ for each node in one write.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: nodeId, edgeId.

          • nodeId (string) –

            The ID of the node. For an ontology schema node, use its iri: reference, which every write accepts.

          • edgeId (dict) –

            The edge, identified by the IDs of its start and end nodes. The edge type is in properties.edgeType.

            • from (string) – [REQUIRED]

              The ID of the node where the edge starts.

            • to (string) – [REQUIRED]

              The ID of the node where the edge ends.

        • properties (dict) – [REQUIRED]

          The properties to set, up to 50. {} when there are none. ListChangeSetOperations lists them as it lists those of PutOperation.

          • (string) –

            • (dict) –

              The value of a property on a node or an edge in an agent context. Exactly one member is set, and the member that is set determines the value’s type.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: stringValue, intValue, longValue, boolValue, floatValue, doubleValue, stringListValue, intListValue, longListValue, floatListValue, doubleListValue, boolListValue.

              • stringValue (string) –

                A string value, up to 2,048 characters.

              • intValue (integer) –

                A 32-bit signed integer value.

              • longValue (integer) –

                A 64-bit signed integer value.

              • boolValue (boolean) –

                A Boolean value.

              • floatValue (float) –

                A single-precision (32-bit) floating-point value.

              • doubleValue (float) –

                A double-precision (64-bit) floating-point value.

              • stringListValue (list) –

                A list of up to 1,000 string values, each up to 2,048 characters.

                • (string) –

              • intListValue (list) –

                A list of up to 1,000 32-bit signed integer values.

                • (integer) –

              • longListValue (list) –

                A list of up to 1,000 64-bit signed integer values.

                • (integer) –

              • floatListValue (list) –

                A list of up to 1,000 single-precision (32-bit) floating-point values.

                • (float) –

              • doubleListValue (list) –

                A list of up to 1,000 double-precision (64-bit) floating-point values.

                • (float) –

              • boolListValue (list) –

                A list of up to 1,000 Boolean values.

                • (boolean) –

      • delete (dict) –

        Removes a node or edge. A deleted node takes its unowned edges.

        • entity (dict) – [REQUIRED]

          The node or edge to remove.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: nodeId, edgeId.

          • nodeId (string) –

            The ID of the node. For an ontology schema node, use its iri: reference, which every write accepts.

          • edgeId (dict) –

            The edge, identified by the IDs of its start and end nodes. The edge type is in properties.edgeType.

            • from (string) – [REQUIRED]

              The ID of the node where the edge starts.

            • to (string) – [REQUIRED]

              The ID of the node where the edge ends.

        • properties (dict) –

          An edge delete requires edgeType, which with the two node IDs names the edge. A node delete ignores properties on input, so a listed delete can be sent back. A property value over the Metadata input limit (a long list property of the deleted node) is refused before it is ignored. ListChangeSetOperations returns the properties the entity had when the change was made: a node’s nodeType and nodeName, an edge’s edgeType.

          • (string) –

            • (dict) –

              The value of a property on a node or an edge in an agent context. Exactly one member is set, and the member that is set determines the value’s type.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: stringValue, intValue, longValue, boolValue, floatValue, doubleValue, stringListValue, intListValue, longListValue, floatListValue, doubleListValue, boolListValue.

              • stringValue (string) –

                A string value, up to 2,048 characters.

              • intValue (integer) –

                A 32-bit signed integer value.

              • longValue (integer) –

                A 64-bit signed integer value.

              • boolValue (boolean) –

                A Boolean value.

              • floatValue (float) –

                A single-precision (32-bit) floating-point value.

              • doubleValue (float) –

                A double-precision (64-bit) floating-point value.

              • stringListValue (list) –

                A list of up to 1,000 string values, each up to 2,048 characters.

                • (string) –

              • intListValue (list) –

                A list of up to 1,000 32-bit signed integer values.

                • (integer) –

              • longListValue (list) –

                A list of up to 1,000 64-bit signed integer values.

                • (integer) –

              • floatListValue (list) –

                A list of up to 1,000 single-precision (32-bit) floating-point values.

                • (float) –

              • doubleListValue (list) –

                A list of up to 1,000 double-precision (64-bit) floating-point values.

                • (float) –

              • boolListValue (list) –

                A list of up to 1,000 Boolean values.

                • (boolean) –

Return type:

dict

Returns:

Response Syntax

{
    'agentContextId': 'string',
    'status': 'DRAFT'|'PENDING'|'AUTHORIZED'|'SUPPRESSED'|'PUBLISHED'|'FAILED',
    'createdAt': datetime(2015, 1, 1),
    'updatedAt': datetime(2015, 1, 1),
    'accessControl': 'ACL_RESTRICTED'|'NO_ACL',
    'generatedBy': 'DATA_SOURCE_EXTRACTION'|'DATA_SOURCE_INGESTION'|'ENTITY_RESOLUTION'|'ONTOLOGY_GROUNDING'|'TRACE_ANALYSIS'|'IMPORT_DATA_DICTIONARY_TASK'|'IMPORT_VERIFIED_QUERIES_TASK'|'IMPORT_ONTOLOGY_TASK'|'DIRECT_MODIFICATION',
    'statusReason': {
        'code': 'REQUEST_EXPIRED'|'CONNECTION_REMOVED',
        'message': 'string'
    },
    'id': 'string',
    'changeSetVersion': 123
}

Response Structure

  • (dict) –

    The change set version the edit created. Read its operations with ListChangeSetOperations.

    • agentContextId (string) –

      The agent context’s ID.

    • status (string) –

      The status of the change set. Valid values:

      • DRAFT - AWS Context is evaluating the change set against the agent context’s curation policies.

      • PENDING - Held for review as a curation proposal. While the change set is PENDING, you can remove operations from it with UpdateChangeSet.

      • AUTHORIZED - The change set is approved, and AWS Context is applying it.

      • SUPPRESSED - AWS Context won’t apply the change set, because a curation policy denied it or its curation proposal was closed without approval.

      • PUBLISHED - AWS Context applied the change set to the agent context.

      • FAILED - AWS Context couldn’t apply the change set.

      SUPPRESSED and PUBLISHED are final. A FAILED change set can still change to PUBLISHED or PENDING if AWS Context retries applying it. New values can be added, so handle a status that you don’t recognize.

    • createdAt (datetime) –

      The date and time when the change set was created.

    • updatedAt (datetime) –

      The date and time when the change set was last updated, such as when its status changed or its operations were edited.

    • accessControl (string) –

      See AccessControl. The service returns it on every item.

      Valid values:

      • ACL_RESTRICTED - Only an allowed end user can read the content (its operations), and the change set can’t be edited. Every caller can read its metadata, and its proposal’s title names no nodes or edges.

      • NO_ACL - Every caller can read the content.

    • generatedBy (string) –

      The activity that generated the change set. A change set that an IMPORT_ONTOLOGY task writes carries IMPORT_ONTOLOGY_TASK, and one that a CreateChangeSet call makes carries DIRECT_MODIFICATION. A sync of a connected data source’s own metadata, such as an AWS Glue Data Catalog sync, carries DATA_SOURCE_INGESTION. To list the change sets that carry a value, filter ListChangeSets on it.

      This member can be absent, so handle a change set that has no activity. For example, it’s absent on a change set that records a connection’s removal, on a change set that AWS Context wrote when it loaded an ontology’s schema, and on a change set whose activity this API version doesn’t recognize.

    • statusReason (dict) –

      Why AWS Context created or closed the change set, for example because a connection was removed from the agent context. AWS Context keeps it across later status changes, including a curator’s decision. Absent when AWS Context gave no reason.

      • code (string) –

        Why the change happened. AWS Context currently sets CONNECTION_REMOVED. Handle a value you don’t recognize.

      • message (string) –

        A human-readable description. Don’t parse it.

    • id (string) –

      The change set’s opaque instance ID. Requests take it as changeSetId.

    • changeSetVersion (integer) –

      The version the edit created. Pass it to the next UpdateChangeSet.

Exceptions