Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Entity Pluralism #22

Open
5 tasks
cvauclair opened this issue Feb 4, 2025 · 0 comments
Open
5 tasks

feat: Entity Pluralism #22

cvauclair opened this issue Feb 4, 2025 · 0 comments

Comments

@cvauclair
Copy link
Contributor

cvauclair commented Feb 4, 2025

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 S touches an entity E if it either: 1) defines a relation pointing to or from that entity E; or 2) defines a triple for that entity E.
  • A source space S' can be defined for any entity E in some space S.
  • A space S can 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 S can 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:

  1. If a source space S' is defined for entity E in space S and S' is part of a space hierarchy (i.e.: it has a parent space), then the triples returned for entity E in space S are all triples defined in all spaces of the space hierarchy between the root of the space hierarchy (not necessarily the root space) and space S', in addition to the triples defined in space S. 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).
  2. If no source space is defined for entity E in space S and S is part of a space hierarchy (i.e.: it has a parent space) then the triples returned for entity E in space S are aggregated according to the algorithm above with the parent of S as the source space.
  3. If no source space is defined for entity E in space S and S is not part of a hierarchy, then the triples returned for entity E in space S will include those defined in space S as well as the triples defined in the top ranked space that touches this entity, with precedence given to the triples defined in S.

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.
@cvauclair cvauclair changed the title feat: Pluralism feat: Entity Pluralism Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant