gqlalchemy
gqlalchemy copied to clipboard
Extend `NxTranslator`
The NxTranslator
has been changed to inherit from the Translator
class, but not all of its parts of code have been adjusted accordingly. For example:
- All exported from the module: https://github.com/memgraph/gqlalchemy/blob/main/gqlalchemy/transformations/translators/nx_translator.py#L161
- Naming (probably better
to_cypher_queries_parallel
, sincenx_to_cypher
was changed intoto_cypher_queries
): https://github.com/memgraph/gqlalchemy/blob/main/gqlalchemy/transformations/translators/nx_translator.py#L174 - Internally, Memgraph saves NetworkX ID as
id
while for PyG and DGL, it saves them aspyg_id
anddgl_id
, respectively. It can be changed, but not necessarily.
Besides that, import and export are not following the same set of rules. Translate from Nx graph to Memgraph rules:
- Values of
labels
key in Nx graph -> node labels in Memgraph - Value of
TYPE
key in Nx graph -> relationship type in Memgraph
Translate from Memgraph graph to Nx graph rules:
- node labels in Memgraph -> Values of
label
key in Nx graph - relationship type in Memgraph -> Value of
type
key in Nx graph