-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Motivation
One of the main goals of the knowledge graph is to allow for natural composability. This is mostly done through the use of global IDs for entities. This is especially important when a triple is created in a space which refers to some entity that exists in another space. When that happens, we want the "view" of the entity in that first space to sometimes include triples of other spaces. This is called pluralism.
Design
Definitions
- We say that some space
Stouches an entityEif it either: 1) defines a relation pointing to or from that entityE; or 2) defines a triple for that entityE. - A source space
S'can be defined for any entityEin some spaceS. - A space
Scan have a parent space as well as subspaces (spaces for which it is the parent space). A set of spaces related through subspaces relationships are called a space hierarchy. The space hierarchy can have one or more roots (spaces in the hierarchy with no parent space) and leaves (spaces in the hierarchy with no subspaces). - The global graph is one such space hierarchy, specifically the one where the Root space (id
25omwWh6HYgeRQKCaSpVpa) is the root of the hierarchy. - A space
Scan have verified spaces (or trusted spaces) which are spaces outside of its hierarchy but that are nonetheless closely related to it and more importantly, spaces that have been vetted. - A space ranking is a ranking of all spaces that are part of the global graph. Many such ranking can exist (e.g.: proximity to the Root space, relevance, number of entities, etc.) and those can be used to determine the most likely target space for an entity reference in cases where it is not defined.
Entity Triples
If the entity E is only ever touched by space S, then the triples returned for entity E in space S are the triples defined in that space.
If the entity E was touched by spaces other than space S, then the triples returned for entity E in space S are the triples defined in that space in addition to other triples according to the following rules, in order of priority:
- If a source space
S'is defined for entityEin spaceSandS'is part of a space hierarchy (i.e.: it has a parent space), then the triples returned for entityEin spaceSare all triples defined in all spaces of the space hierarchy between the root of the space hierarchy (not necessarily the root space) and spaceS', in addition to the triples defined in spaceS. In the case where multiple spaces set a value for the same attribute, priority is given to the one set in the space lowest in the hierarchy (i.e.: the more "specific" spaces). - If no source space is defined for entity
Ein spaceSandSis part of a space hierarchy (i.e.: it has a parent space) then the triples returned for entityEin spaceSare aggregated according to the algorithm above with the parent ofSas the source space. - If no source space is defined for entity
Ein spaceSandSis not part of a hierarchy, then the triples returned for entityEin spaceSwill include those defined in spaceSas well as the triples defined in the top ranked space that touches this entity, with precedence given to the triples defined inS.
Implementation
The plan is to start implementing this feature gradually. Here are some rough steps/milestones:
- Implement a simple "placeholder" space ranking (e.g.: oldest first)
- Implement rule 4. with the placeholder ranking
- Handle entity source space definition (currently not handled/modelled)
- Implement rule 1.
- Implement rule 2.