biocypher.output.write.graph._neo4j._Neo4jBatchWriter

class biocypher.output.write.graph._neo4j._Neo4jBatchWriter(*args, **kwargs)

Class for writing node and edge representations to disk using the format specified by Neo4j for the use of admin import. Each batch writer instance has a fixed representation that needs to be passed at instantiation via the schema argument. The instance also expects an ontology adapter via ontology_adapter to be able to convert and extend the hierarchy.

This class inherits from the abstract class “_BatchWriter” and implements the Neo4j-specific methods:

  • _write_node_headers

  • _write_edge_headers

  • _construct_import_call

  • _write_array_string

__init__(*args, **kwargs)

Constructor.

Check the version of Neo4j and adds a command scope if version >= 5.

Returns:

An instance of the writer.

Return type:

_Neo4jBatchWriter

Methods

__init__(*args, **kwargs)

Constructor.

get_import_call()

Function to return the import call detailing folder and individual node and edge headers and data files, as well as delimiters and database name.

write_edges(edges[, batch_size])

Wrapper for writing edges and their headers.

write_import_call()

Function to write the import call detailing folder and individual node and edge headers and data files, as well as delimiters and database name, to the export folder as txt.

write_nodes(nodes[, batch_size, force])

Wrapper for writing nodes and their headers.

Attributes

import_call_file_prefix

Property for output directory path.