I am pretty new to DGraph and graph database in general so I may be overthinking my problem… or not.
From the tutorial material I can not seem to find how to schematize an “ordered list of edges”.
Eg. A chat conversation using only emoticons. This is what I have:
Can I get rid of author_0 and author_1 and keep the order, eg. to map the proper author with msg_x (let assume the business logic enforces alternate posting of messages)? Same thing for msg_0, …, msg_x.
I think your approach is a little wrong. You will create multiple predicates. that way pollutes your scheme completely. Imagine the moment you are pulling your schema. It will come thousands of predicates.
The best thing to do is to create specific Nodes for each emoji (Or even in the application use a pattern already produced from third parties. Nor would you need to create ““physical nodes”” in DB Dgraph). Then connect them Via UID. In that case your application would have to deal with this UID translation for emoticon. in this case you would have a predicate called Body, which would be the body of the message. And your application would translate specific body points from that message as emoticon.
See this example below. It’s old, but I think it’a aligned with todays parameters. And I still have to finish and remodel some things there. It was a sketch I created to set up a chat. https://realtimeboard.com/app/board/o9J_k0N22Eo=/