Skip to content

Commit

Permalink
update the RDF writer to be compatible with latest changes of Biocypher.
Browse files Browse the repository at this point in the history
  • Loading branch information
LoesvdBiggelaar committed Apr 5, 2024
1 parent 0e06071 commit 94a7207
Show file tree
Hide file tree
Showing 4 changed files with 659 additions and 1 deletion.
2 changes: 1 addition & 1 deletion biocypher/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def write_nodes(
tnodes = nodes
# write node files
return self._writer.write_nodes(
tnodes, batch_size=batch_size, force=force
tnodes, batch_size=batch_size
)

def write_edges(self, edges, batch_size: int = int(1e6)) -> bool:
Expand Down
2 changes: 2 additions & 0 deletions biocypher/write/_batch_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def __init__(
db_password: str = None,
db_host: str = None,
db_port: str = None,
rdf_format: str = None
):
"""
Expand Down Expand Up @@ -202,6 +203,7 @@ class contains all methods expected by a bach writer instance, some of
self.db_password = db_password
self.db_host = db_host or "localhost"
self.db_port = db_port
self.rdf_format = rdf_format

self.delim, self.escaped_delim = self._process_delimiter(delimiter)
self.adelim, self.escaped_adelim = self._process_delimiter(
Expand Down
4 changes: 4 additions & 0 deletions biocypher/write/_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from biocypher.write.graph._arangodb import _ArangoDBBatchWriter
from biocypher.write.relational._sqlite import _SQLiteBatchWriter
from biocypher.write.relational._postgresql import _PostgreSQLBatchWriter
from biocypher.write.relational._rdf import _RDFwriter

logger.debug(f"Loading module {__name__}.")

Expand All @@ -43,6 +44,8 @@
"ArangoDB": _ArangoDBBatchWriter,
"sqlite": _SQLiteBatchWriter,
"sqlite3": _SQLiteBatchWriter,
"rdf": _RDFwriter,
"RDF": _RDFwriter,
}


Expand Down Expand Up @@ -102,4 +105,5 @@ def get_writer(
db_user=dbms_config.get("user"), # psql
db_password=dbms_config.get("password"), # psql
db_port=dbms_config.get("port"), # psql
rdf_format= dbms_config.get("rdf_format")
)
Loading

0 comments on commit 94a7207

Please sign in to comment.