memgraph / gqlalchemy

GQLAlchemy is a library developed with the purpose of assisting in writing and running queries on Memgraph. GQLAlchemy supports high-level connection to Memgraph as well as modular query builder.
https://pypi.org/project/gqlalchemy/
Apache License 2.0
226 stars 32 forks source link

Adds properties on edges #306

Closed andrejtonev closed 4 months ago

andrejtonev commented 9 months ago

Define relationship properties in many_to_many via name_mappings and properties field

andrejtonev commented 9 months ago

@antepusic I changed the code a bit. Had some CI problems, not sure why it didn't like the first version...

katarinasupe commented 5 months ago

Related docs:

katarinasupe commented 5 months ago

Hi @andrejtonev, the related how to guide needs to be properly updated (reference guide is automated), and you should rebase to main. We no longer use the develop branch for the release; everything goes directly to the main.

FYI, as discussed, this will be included in the next release (July 10th). Work on Memgraph is a priority, so we can move the milestone due date if you can't make it.

andrejtonev commented 5 months ago

one_to_many: passing field parameters (which already existed but was not used) many_to_many: changed from parameters to column_names_mapping using the mapping and columns to define properties ignoring from to keys when adding properties

Description

Responding to user-made issue. Requesting the ability to define properties on edges. Something similar was already present, but was not used and needed to be expanded to support mappings. Mappings are only supported for many_to_many one_to_many only supports predefined and fixed parameters defined via the configuration file.

Pull request type

Please delete options that are not relevant.

Related issues

Delete section if this PR doesn't resolve any issues.

Closes #301

Checklist:

######################################

Reviewer checklist (the reviewer checks this part)

######################################

andrejtonev commented 5 months ago

Do not merge Need to update implementation.

  1. Use name mappings instead of a local column name map.
  2. ~Figure out how/if to implement one_to_many edge parameters~ Remove one_to_many edge parameters. We cannot add information not present in one of the nodes (edge created via node creation triggers). We could add a fixed param, but I just don't see a good use-case at the moment.
andrejtonev commented 5 months ago

@antepusic @Josipmrden I didn't like my previous implementation. Made a few changes. Please take another look Thanks

andrejtonev commented 5 months ago

@katarinasupe I updated the relevant docs. Changed the example for the one_to_many and added one for many_to_many.

katarinasupe commented 4 months ago

@andrejtonev Merge the latest main for tests to pass. Once the tests pass, feel free to squash and merge.