Hello,I keep struggling to grasp the proper way to store particular objects into the database. Suppose I have an Article. Without any storage implementations, I might represent it as this:public class Article {private String name;private Contributor creator;private Set<Piece> components;private Set<GinRecord> history;}So a Piece is a single component of an Article (e.g. Text, Media, Poll), and many of them compose an article. It is an abstract class, so the Set will actually be populated by Piece's subclasses.A GinRecord itself has three fields, {GinRibbon type, which is an enum related to the type of modification involved} and {Contributor initiator, pretty self-explanatory} and {String[] details, which gives out information as to the nature of the modification (e.g. previous entry vs. new entry, field changed)}.Do I have to create an HGProjection type to handle Article.name?I think I can deal with an HGLink for Article.creator.Is it better to deal with the relationship between Article and Article.components via another HGLink?And for Article.history, how do I make use of the existing Record stuff and still be able to navigate deep within the fields? I want to be able to execute a HGQuery that involves something akin to a hg.part("history.type", "NAME_CHANGE", ComparisionOperator.EQ) to get a list of all the modifications that have to do with someone changing something's name somewhere.Thanks.--
You received this message because you are subscribed to the Google Groups "HyperGraphDB" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hypergraphdb/-/pSyna-fyuf4J.
To post to this group, send email to hyperg...@googlegroups.com.
To unsubscribe from this group, send email to hypergraphdb...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hypergraphdb?hl=en.
Well, I could add a lot I suppose. I think the main confusion is
probably what role links play in the representation of beans
(specifically nested structures like Sandeep's example). The answer
is: none, links are independent. This means the graph structure is
something orthogonal to (i.e. independent of) the representation of
complex objects. That's a choice I made very early on with the idea
that a value of an atom should be something arbitrary and it shouldn't
interfere with the graph structure.
The idea is that if one wants to represent bean structures at the
level of the atom graph, one can always write custom types to do it.
However the current interfaces don't make it easy to do this in a
generic way. So, as a note about roadmap and the future of HGDB, I
think the type system needs to be redesigned seriously with a change
in the core interfaces (HGAtomType etc.). Alain, and maybe others that
have customized it, will kill me for that, but I think it's necessary
in order to me forward :)
Thank you, Alain. That greatly refreshes my perspective.I have another question. How does the implementation of Record actually work? Is it just an object that we create an instance of and add to the database, where it reasons with the preexisting RecordType, or do we need to tweak it further?
--
You received this message because you are subscribed to the Google Groups "HyperGraphDB" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hypergraphdb/-/SozL6GwBVM4J.