4.2 KiB
4.2 KiB
- A
deltais an immutable atomic unit that relates one or more values in semantically meaningful ways as of some point in time. A delta can be thought of as both aCRDTand as ahyper-edgein the implicit hypergraph that makes up the rhizome. A delta contains one or morepointers. - A
pointeris composed of at least two and possibly three fields. Adeltacontains a set ofpointers. The fields of a pointer are:name- identifies the meaning of the pointer from the perspective of the delta that contains it.target- identifies avalueto associate with thename.context- optionally, when pointing at anobject, thecontextidentifies the field or property of that object with which this delta is associated.
- A
valueis one of two kinds of primitive that can be referred to by adelta:- a
referenceis a UUID or other value understood to be pointing at either adeltaor anobject. - a
primitiveis a literal string, number or boolean value whose meaning is not tied up in its being a reference to a larger whole.
- a
- An
objectis a composite object whose entire existence is encoded as the set of deltas that reference it. An object is identified by a uniquereference, and every delta that includes thatreferenceis asserting a claim about some property of that object. - A
negationis a specific kind of delta that includes a pointer with the namenegates, atargetreference to another delta, and acontextcallednegated_by. - a
schemarepresents a template by which anobjectcan be compiled into ahyperview. A schema specifies which properties of that object are included, and it specifies schemas for the objects references by the deltas within those properties. A schema must terminate in primitive schemas to avoid an infinite regress.- For instance, a
hyperview"User" of a user may include references to friends. If those friends are in turn encoded as instances of the "User" schema then all of their friends would be fully encoded, etc. - This could lead to circular references and arbitrarily deep nesting, which runs into the problem of "returning the entire graph". So our schema should specify, for instance, that the "friends" field apply the "Summary" schema to referenced users rather than the "User" schema, where the "Summary" schema simply resolves to username and photo.
- For instance, a
- A
hyperviewis a representation of anobjectthat includes a full inventory of all of the deltas that compose that object. So for instance, a hyperview of the object representing the user "Alice" might includealice.name, which contains an array of all deltas with a pointer whosetargetis the ID of Alice and whose context isname. Such deltas would likely include a second pointer with the namenameand the target a primitive string "Alice", for instance.- A
hyperviewmay also include nested delta/object layering. Consideralice.friends, which would include all deltas asserting friendship between Alice and some other person. Each such delta would reference a different friend object. In a hyperview, these references would be expanded to contain hyperviews of those friends. Schemas, as defined above, would be applied to constrain tree depth and avoid infinite regress.
- A
- A
viewis a compression of ahyperviewthat removes delta information and flattens the structure into a standard domain object, typically in JSON. So instead ofalice.nameresolving to a list of deltas that assert the object's name it might simply resolve to"alice".- Note that in a hyperview any property of an object necessarily resolves to a set of deltas, even if it's an empty set, because we cannot anticipate how many deltas exist that assert values on that context.
- In collapsing a hyperview into a view we may specify
resolution strategieson each field of the schema. A resolution strategy takes as input the set of all deltas targeting that context and returns as output the value in the view. So if we have 15 deltas asserting the value for an object's name, our resolution strategy may simply say "return the target of thenamepointer associated with the most recent delta", or it may say "return an array of names". If the value is numeric it may say "take the max" or "take the min" or "take the average".