biocypher.output.connect._neo4j_driver._Neo4jDriver
- class biocypher.output.connect._neo4j_driver._Neo4jDriver(database_name: str, uri: str, user: str, password: str, multi_db: bool, translator: Translator, wipe: bool = False, fetch_size: int = 1000, increment_version: bool = True)
Manages a BioCypher connection to a Neo4j database using the
neo4j_utils.Driver
class.- Parameters:
database_name (str) – The name of the database to connect to.
wipe (bool) – Whether to wipe the database before importing.
uri (str) – The URI of the database.
user (str) – The username to use for authentication.
password (str) – The password to use for authentication.
multi_db (bool) – Whether to use multi-database mode.
fetch_size (int) – The number of records to fetch at a time.
increment_version (bool) – Whether to increment the version number.
translator (Translator) – The translator to use for mapping.
- __init__(database_name: str, uri: str, user: str, password: str, multi_db: bool, translator: Translator, wipe: bool = False, fetch_size: int = 1000, increment_version: bool = True)
Methods
__init__
(database_name, uri, user, password, ...)add_biocypher_edges
(edges[, explain, profile])Accepts an edge type handoff class (
biocypher.create.BioCypherEdge
) with source and target ids, label, and a dict of properties (passing on the type of property, ie, int, string ...).add_biocypher_nodes
(nodes[, explain, profile])Accepts a node type handoff class (
biocypher.create.BioCypherNode
) with id, label, and a dict of properties (passing on the type of property, ie,int
,str
, ...).add_edges
(id_src_tar_type_tuples)Generic edge adder method to add any kind of input to the graph via the
biocypher.create.BioCypherEdge
class.add_nodes
(id_type_tuples)Generic node adder method to add any kind of input to the graph via the
biocypher.create.BioCypherNode
class.init_db
()Used to initialise a property graph database by setting up new constraints.