Skip to content

Save metadata for vertices and edges #54

Open

Description

@egze

My use case is to build a Graph from data coming from a DB. When there are changes to it, I want to persist it back to DB.

For this to work, I am currently abusing the labels from vertices and edges. For vertex it is a Keyword list and for edges it is a map.

It would be much more convenient if there was a metadata field for both and a function to set it. Something like:

Graph.put_metadata(g, v, %{id: 1234, comment: "some comment"}) # sets metadata for vertex
Graph.put_metadata(g, v1, v2, l, %{id: 1234, comment: "some comment"}) # sets metadata for edge

I can create a PR if this is a worthwhile feature.

Activity

  1. cjbottaro commented on Jan 16, 2023

    @cjbottaro

    I would also like to attach arbitrary metadata to edges!

  2. zachallaun commented on Mar 2, 2023

    @zachallaun

    This would be very nice to have. I'm similarly abusing labels to store metadata on edges.

  3. Papipo commented on Mar 16, 2023

    @Papipo

    I can create a PR if this is a worthwhile feature.

    It definitely is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions