gqlalchemy icon indicating copy to clipboard operation
gqlalchemy copied to clipboard

Extend `NxTranslator`

Open katarinasupe opened this issue 1 year ago • 0 comments

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, since nx_to_cypher was changed into to_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 as pyg_id and dgl_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

katarinasupe avatar May 15 '23 14:05 katarinasupe