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

New Feature: Adding Relations Support #153

Open
soldni opened this issue Oct 5, 2022 · 1 comment
Open

New Feature: Adding Relations Support #153

soldni opened this issue Oct 5, 2022 · 1 comment
Assignees

Comments

@soldni
Copy link
Member

soldni commented Oct 5, 2022

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 based ids

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.

@soldni
Copy link
Member Author

soldni commented Oct 5, 2022

ACTUALLY @josephcc hates the meh face operation ._.; so instead we are going to have three different to look for things based on type of lookup:

  • sg.context: does the current symbols-based intersection (e.g., you now do sg.context.tokens instead of sg.tokens)
  • sg.intersection: does visual intersection (this is new and will have to be implemented)
  • sg.relations: looks up relations between objects (was going to be ._. face)

@soldni soldni changed the title Adding relations support New Feature: Adding Relations Support Oct 5, 2022
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

2 participants