Gremlinq / ExRam.Gremlinq

A .NET object-graph-mapper for Apache TinkerPop™ Gremlin enabled databases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for properties not strongly typed on Vertex/Edge

LoungeFlyZ opened this issue · comments

In my application I have a mixture of well known and understood properties on entities like Person, along with unknown properties that are supplied by the user of the application. e.g. My awesome property = "Foo". And I would like to (ideally) model this as regular properties in the graph on Person vertices. I am, of course, open to workarounds or suggestions on how i'm doing it wrong and other alternatives. I'm a gremlin rookie after all.

I was thinking something like a Dictionary of additional properties that were found on a Vertex that were not mapped to strongly typed properties.

    public class Vertex :  IVertex
    {
        public object Id { get; set; }
        public string Label { get; set; }
        public string pk { get; set; } = "pk";
        public Dictionary<string, object> AdditionalProperties { get; set; }
    }

I realize that this library provides a strongly typed mapping, but it seems to me there will be situations like mine that are runtime specific.

Thoughts?

I could of course be thinking about this completely wrong and could model this in a different manner that I am not aware of.

This has been proposed previously in #82. I agree that this would be a nice to have feature, but it's currently not on the roadmap.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.