@balkamm wrote:
Thanks for the reply!
Another way to explain the use-case is as a D&D random character generator. For that narrow use-case, I could hard-code it, because I know that Characters have a Race and a Class, etc. up front. However, I’d like to generalize this feature into an arbitrary thing generator, where a thing could be a Character or a city or a weapon, etc.
Say I want to generate a random a random thing of <dgraph.type> “Foo”. I’d need to:
- Enumerate all the predicates for “Foo”.
- For each predicate find out what the “range” is (i.e. the scalar type or the <dgraph.type> of a uid predicate)
- If it’s a uid predicate, then it’s probably just a uniform choice among all the objects with that <dgraph.type> though some choices might be more common than others. If it’s not a uniform choice, I’d like to be able to express the relative odds of each choice.
- If it’s a scalar type, we’ll want some some description of the distribution of values to choose from. Even if it’s uniformly distributed, there will probably be limits like a narrower range of values, etc.
I know I can express all these things if types and predicates have uids, though I haven’t totally worked out what the schema schema would be yet. I’m also pretty sure I could express this in an RDF data store, but I was excited to try out dgraph because of the distributed nature and apparent scalability/performance benefits over those types of stores.
Thanks!