API Reference
biokb_ipni.import_data
Import all data in database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
engine
|
Optional[Engine]
|
SQLAlchemy engine. Defaults to None. |
None
|
force_download
|
bool
|
If True, will force download the data, even if files already exist. If False, it will skip the downloading part if files already exist locally. Defaults to False. |
False
|
delete_files
|
bool
|
If True, downloaded files are deleted after import. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
Dict[str, int]: table=key and number of inserted=value |
Source code in biokb_ipni/db/manager.py
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |
biokb_ipni.create_ttls
Create all turtle files.
If engine=None tries to get the settings from environment else uses the default engine.
If export_to_folder is provided, turtle files are exported to this folder. Otherwise, the default export folder (~/.biokb/ipni/data) is used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
engine
|
Engine | None
|
SQLAlchemy engine. Defaults to None. |
None
|
export_to_folder
|
str | None
|
Folder to export ttl files. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
path zipped file with ttls. |
Source code in biokb_ipni/rdf/turtle.py
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
biokb_ipni.import_ttls
Import data into Neo4J from zipped turtle files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
neo4j_uri
|
str | None
|
URI of the Neo4j database. |
None
|
neo4j_user
|
str | None
|
Username for Neo4j. |
None
|
neo4j_pwd
|
str | None
|
Password for Neo4j. |
None
|
delete_existing_graph
|
bool
|
delete existing graph before import. |
True
|
Returns: bool: True if import is successful.
Source code in biokb_ipni/rdf/neo4j_importer.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |