Skip to content

start_import_task async

start_import_task(
    source: str,
    graph_identifier: GraphIdentifier,
    role_arn: RoleArn,
    *,
    config_overrides: Optional[AsyncNeptuneGraphClientConfig] = None,
    import_options: Optional[ImportOptions] = None,
    fail_on_error: Optional[bool] = None,
    format: Optional[Format] = None,
    parquet_type: Optional[ParquetType] = None,
    blank_node_handling: Optional[BlankNodeHandling] = None,
) -> StartImportTaskOutput

Import data into existing Neptune Analytics graph from Amazon Simple Storage Service (S3). The graph needs to be empty and in the AVAILABLE state.

Parameters:

  • fail_on_error (Optional[bool], default: None ) –

    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.

  • source (str) –

    A URL identifying 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.

  • format (Optional[Format], default: None ) –

    Specifies the format of Amazon S3 data to be imported. Valid values are CSV, which identifies the Gremlin CSV format or OPENCYPHER, which identifies the openCypher load format.

  • parquet_type (Optional[ParquetType], default: None ) –

    The parquet type of the import task.

  • blank_node_handling (Optional[BlankNodeHandling], default: None ) –

    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.

  • graph_identifier (GraphIdentifier) –

    The unique identifier of the Neptune Analytics graph.

  • role_arn (RoleArn) –

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

Raises:

Source code in docs_src/capo_neptune_graph/_services/async_neptune_graph.py
async def start_import_task(
    self,
    source: str,
    graph_identifier: "capo_neptune_graph.types.graph_identifier.GraphIdentifier",
    role_arn: "capo_neptune_graph.types.role_arn.RoleArn",
    *,
    config_overrides: Optional[AsyncNeptuneGraphClientConfig] = None,
    import_options: Optional[
        "capo_neptune_graph.types.import_options.ImportOptions"
    ] = None,
    fail_on_error: Optional[bool] = None,
    format: Optional["capo_neptune_graph.types.format.Format"] = None,
    parquet_type: Optional[
        "capo_neptune_graph.types.parquet_type.ParquetType"
    ] = None,
    blank_node_handling: Optional[
        "capo_neptune_graph.types.blank_node_handling.BlankNodeHandling"
    ] = None,
) -> "capo_neptune_graph.types.start_import_task_output.StartImportTaskOutput":
    """<p>Import data into existing Neptune Analytics graph from Amazon Simple Storage Service (S3). The graph needs to be empty and in the AVAILABLE state.</p>

    Args:
        fail_on_error: <p>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.</p>
        source: <p>A URL identifying 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.</p>
        format: <p>Specifies the format of Amazon S3 data to be imported. Valid values are CSV, which identifies the Gremlin CSV format or OPENCYPHER, which identifies the openCypher load format.</p>
        parquet_type: <p>The parquet type of the import task.</p>
        blank_node_handling: <p>The method to handle blank nodes in the dataset. Currently, only <code>convertToIri</code> is supported, meaning blank nodes are converted to unique IRIs at load time. Must be provided when format is <code>ntriples</code>. For more information, see <a href="https://docs.aws.amazon.com/neptune-analytics/latest/userguide/using-rdf-data.html#rdf-handling">Handling RDF values</a>.</p>
        graph_identifier: <p>The unique identifier of the Neptune Analytics graph.</p>
        role_arn: <p>The ARN of the IAM role that will allow access to the data that is to be imported.</p>

    Raises:
        capo_neptune_graph.errors.conflict_exception.ConflictException: <p>Raised when a conflict is encountered.</p>
        capo_neptune_graph.errors.internal_server_exception.InternalServerException: <p>A failure occurred on the server.</p>
        capo_neptune_graph.errors.resource_not_found_exception.ResourceNotFoundException: <p>A specified resource could not be located.</p>
        capo_neptune_graph.errors.throttling_exception.ThrottlingException: <p>The exception was interrupted by throttling.</p>
        capo_neptune_graph.errors.validation_exception.ValidationException: <p>A resource could not be validated.</p>
        capo_neptune_graph.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_neptune_graph.types.start_import_task_input.StartImportTaskInput]",
    ) -> AsyncOperationResponse[
        "capo_neptune_graph.types.start_import_task_output.StartImportTaskOutput"
    ]:
        import capo_neptune_graph._operations.amazon_neptune_graph.start_import_task

        (
            output,
            http_response,
        ) = await capo_neptune_graph._operations.amazon_neptune_graph.start_import_task.async_start_import_task(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartImportTask")
    )
    input_: capo_neptune_graph.types.start_import_task_input.StartImportTaskInput = {
        "source": source,
        "graph_identifier": graph_identifier,
        "role_arn": role_arn,
    }
    if import_options is not None:
        input_["import_options"] = import_options
    if fail_on_error is not None:
        input_["fail_on_error"] = fail_on_error
    if format is not None:
        input_["format"] = format
    if parquet_type is not None:
        input_["parquet_type"] = parquet_type
    if blank_node_handling is not None:
        input_["blank_node_handling"] = blank_node_handling

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output