createGraphUsingImportTask method

Future<CreateGraphUsingImportTaskOutput> createGraphUsingImportTask({
  1. required String graphName,
  2. required String roleArn,
  3. required String source,
  4. BlankNodeHandling? blankNodeHandling,
  5. bool? deletionProtection,
  6. bool? failOnError,
  7. Format? format,
  8. ImportOptions? importOptions,
  9. String? kmsKeyIdentifier,
  10. int? maxProvisionedMemory,
  11. int? minProvisionedMemory,
  12. ParquetType? parquetType,
  13. bool? publicConnectivity,
  14. int? replicaCount,
  15. Map<String, String>? tags,
  16. VectorSearchConfiguration? vectorSearchConfiguration,
})

Creates a new Neptune Analytics graph and imports data into it, either from Amazon Simple Storage Service (S3) or from a Neptune database or a Neptune database snapshot.

The data can be loaded from files in S3 that in either the Gremlin CSV format or the openCypher load format.

May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter graphName : A name for the new Neptune Analytics graph to be created.

The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It cannot end with a hyphen or contain two consecutive hyphens. Only lowercase letters are allowed.

Parameter roleArn : The ARN of the IAM role that will allow access to the data that is to be imported.

Parameter source : A URL identifying to the location of the data to be imported. This can be an Amazon S3 path, or can point to a Neptune database endpoint or snapshot.

Parameter blankNodeHandling : The method to handle blank nodes in the dataset. Currently, only convertToIri is supported, meaning blank nodes are converted to unique IRIs at load time. Must be provided when format is ntriples. For more information, see Handling RDF values.

Parameter deletionProtection : Indicates whether or not to enable deletion protection on the graph. The graph can’t be deleted when deletion protection is enabled. (true or false).

Parameter failOnError : If set to true, the task halts when an import error is encountered. If set to false, the task skips the data that caused the error and continues if possible.

Parameter format : Specifies the format of S3 data to be imported. Valid values are CSV, which identifies the Gremlin CSV format, OPEN_CYPHER, which identifies the openCypher load format, or ntriples, which identifies the RDF n-triples format.

Parameter importOptions : Contains options for controlling the import process. For example, if the failOnError key is set to false, the import skips problem data and attempts to continue (whereas if set to true, the default, or if omitted, the import operation halts immediately when an error is encountered.

Parameter kmsKeyIdentifier : Specifies a KMS key to use to encrypt data imported into the new graph.

Parameter maxProvisionedMemory : The maximum provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph. Default: 1024, or the approved upper limit for your account.

If both the minimum and maximum values are specified, the final provisioned-memory will be chosen per the actual size of your imported data. If neither value is specified, 128 m-NCUs are used.

Parameter minProvisionedMemory : The minimum provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph. Default: 16

Parameter parquetType : The parquet type of the import task.

Parameter publicConnectivity : Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated. (true to enable, or false to disable).

Parameter replicaCount : The number of replicas in other AZs to provision on the new graph after import. Default = 0, Min = 0, Max = 2.

Parameter tags : Adds metadata tags to the new graph. These tags can also be used with cost allocation reporting, or used in a Condition statement in an IAM policy.

Parameter vectorSearchConfiguration : Specifies the number of dimensions for vector embeddings that will be loaded into the graph. The value is specified as dimension=value. Max = 65,535

Implementation

Future<CreateGraphUsingImportTaskOutput> createGraphUsingImportTask({
  required String graphName,
  required String roleArn,
  required String source,
  BlankNodeHandling? blankNodeHandling,
  bool? deletionProtection,
  bool? failOnError,
  Format? format,
  ImportOptions? importOptions,
  String? kmsKeyIdentifier,
  int? maxProvisionedMemory,
  int? minProvisionedMemory,
  ParquetType? parquetType,
  bool? publicConnectivity,
  int? replicaCount,
  Map<String, String>? tags,
  VectorSearchConfiguration? vectorSearchConfiguration,
}) async {
  _s.validateNumRange(
    'maxProvisionedMemory',
    maxProvisionedMemory,
    16,
    24576,
  );
  _s.validateNumRange(
    'minProvisionedMemory',
    minProvisionedMemory,
    16,
    24576,
  );
  _s.validateNumRange(
    'replicaCount',
    replicaCount,
    0,
    2,
  );
  final $payload = <String, dynamic>{
    'graphName': graphName,
    'roleArn': roleArn,
    'source': source,
    if (blankNodeHandling != null)
      'blankNodeHandling': blankNodeHandling.value,
    if (deletionProtection != null) 'deletionProtection': deletionProtection,
    if (failOnError != null) 'failOnError': failOnError,
    if (format != null) 'format': format.value,
    if (importOptions != null) 'importOptions': importOptions,
    if (kmsKeyIdentifier != null) 'kmsKeyIdentifier': kmsKeyIdentifier,
    if (maxProvisionedMemory != null)
      'maxProvisionedMemory': maxProvisionedMemory,
    if (minProvisionedMemory != null)
      'minProvisionedMemory': minProvisionedMemory,
    if (parquetType != null) 'parquetType': parquetType.value,
    if (publicConnectivity != null) 'publicConnectivity': publicConnectivity,
    if (replicaCount != null) 'replicaCount': replicaCount,
    if (tags != null) 'tags': tags,
    if (vectorSearchConfiguration != null)
      'vectorSearchConfiguration': vectorSearchConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/importtasks',
    exceptionFnMap: _exceptionFns,
  );
  return CreateGraphUsingImportTaskOutput.fromJson(response);
}