biocypher 0.9.0__tar.gz → 0.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of biocypher might be problematic. Click here for more details.
- {biocypher-0.9.0 → biocypher-0.9.1}/PKG-INFO +1 -1
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_core.py +25 -4
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_metadata.py +1 -1
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/_get_writer.py +1 -1
- {biocypher-0.9.0 → biocypher-0.9.1}/pyproject.toml +1 -1
- {biocypher-0.9.0 → biocypher-0.9.1}/LICENSE +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/README.md +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/__init__.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/__init__.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/biocypher_config.yaml +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/test_config.yaml +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/test_schema_config.yaml +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/test_schema_config_disconnected.yaml +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_config/test_schema_config_extended.yaml +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_create.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_deduplicate.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_get.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_logger.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_mapping.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_misc.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_ontology.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/_translate.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/__init__.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/connect/__init__.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/connect/_get_connector.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/connect/_neo4j_driver.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/__init__.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/_get_in_memory_kg.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/_in_memory_kg.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/_networkx.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/in_memory/_pandas.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/__init__.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/_batch_writer.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/_writer.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/__init__.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_arangodb.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_neo4j.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_networkx.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_owl.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/graph/_rdf.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/relational/__init__.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/relational/_csv.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/relational/_postgresql.py +0 -0
- {biocypher-0.9.0 → biocypher-0.9.1}/biocypher/output/write/relational/_sqlite.py +0 -0
|
@@ -118,6 +118,15 @@ class BioCypher:
|
|
|
118
118
|
else:
|
|
119
119
|
self._offline = offline
|
|
120
120
|
|
|
121
|
+
# Check if pandas/tabular is being used in offline mode
|
|
122
|
+
if self._offline and self._dbms.lower() in ["pandas", "tabular"]:
|
|
123
|
+
msg = (
|
|
124
|
+
f"The '{self._dbms}' DBMS is only available in online mode. "
|
|
125
|
+
f"If you want to write CSV files, use 'csv' as the DBMS. "
|
|
126
|
+
f"If you want to use pandas, set 'offline: false' in your configuration."
|
|
127
|
+
)
|
|
128
|
+
raise ValueError(msg)
|
|
129
|
+
|
|
121
130
|
if strict_mode is None:
|
|
122
131
|
self._strict_mode = self.base_config["strict_mode"]
|
|
123
132
|
else:
|
|
@@ -225,19 +234,31 @@ class BioCypher:
|
|
|
225
234
|
The knowledge graph is returned based on the `dbms` parameter in
|
|
226
235
|
the biocypher configuration file.
|
|
227
236
|
|
|
237
|
+
TODO: These conditionals are a hack, we need to refactor the in-memory
|
|
238
|
+
KG to be generic, and simplify access and conversion to output formats.
|
|
239
|
+
|
|
228
240
|
Returns
|
|
229
241
|
-------
|
|
230
242
|
Any: knowledge graph.
|
|
231
243
|
|
|
232
244
|
"""
|
|
245
|
+
# If we're using an in-memory KG and it already exists, return it directly
|
|
246
|
+
if self._in_memory_kg and self._is_online_and_in_memory():
|
|
247
|
+
return self._in_memory_kg.get_kg()
|
|
248
|
+
|
|
249
|
+
# Otherwise, initialize and populate the in-memory KG
|
|
233
250
|
if not self._in_memory_kg:
|
|
234
251
|
self._initialize_in_memory_kg()
|
|
235
252
|
if not self._translator:
|
|
236
253
|
self._get_translator()
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
self
|
|
240
|
-
|
|
254
|
+
|
|
255
|
+
# These attributes might not exist when using in-memory KG directly
|
|
256
|
+
if hasattr(self, "_nodes") and hasattr(self, "_edges"):
|
|
257
|
+
tnodes = self._translator.translate_entities(self._nodes)
|
|
258
|
+
tedges = self._translator.translate_entities(self._edges)
|
|
259
|
+
self._in_memory_kg.add_nodes(tnodes)
|
|
260
|
+
self._in_memory_kg.add_edges(tedges)
|
|
261
|
+
|
|
241
262
|
return self._in_memory_kg.get_kg()
|
|
242
263
|
|
|
243
264
|
def _get_deduplicator(self) -> Deduplicator:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|