-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Desired API functionality
given span group/box group sg, we define the following syntax:
T = TypeVar('T', SpanGroup, BoxGroup)
# dot notation ".?"
T -> List[T]
# dot underscore dot "._.?"
T -> List[ RelGroup[T] ]
Data structures need
An index that maps Annotation.id to the annotation itself
For key, we are going to use <field_type, Annotation.id>; a user is no longer allowed to define id, those are internally computed
A RelationGroup class
This is a subclass of Annotation, can have metadata about the relation, links strictly two annotations together.
Indexer, but for relations
This is a mapping from <Annotation, relation_type> to a list of RelationGroup.
Maybe we want to rename the current indexer to intersection_indexer and then have a relations_indexer.
Clean up
- we get rid of
uuids in favor of simpler, integer basedids
Optional nice to have
Consider being able to overload dot notations to bet able to fast track dot-underscore-dot without accessing relations.
In order to do that, we would need to have a table that keeps track of the preferred mode of relations between fields. So for example, page.tokes might be an intersection, but citation.bib might be a relations.