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

Add annotations model and relations #14

Merged
merged 3 commits into from
Oct 9, 2023
Merged

Add annotations model and relations #14

merged 3 commits into from
Oct 9, 2023

Conversation

m0ar
Copy link
Collaborator

@m0ar m0ar commented Oct 5, 2023

No description provided.

@m0ar
Copy link
Collaborator Author

m0ar commented Oct 5, 2023

@hubsmoke Take a look at the annotations model when you have some time, addressing inside component is particularly weird but not sure how to represent it since it would depend on the type of component 🤷


# A way to identify the location of the annotation in the target component
# payload, for example a JSON path, line number, or coordinates in a pdf
path: String @string(maxLength: 512)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we should add more fields here like cid, dpidPath, jsonPath and a generic path

i think we also need a "subPath" field... one locator identifies the component and the other navigates to something inside of it.

it would be nice if mimeType is available (perhaps it's already part of ResearchComponent def?)

Copy link
Collaborator Author

@m0ar m0ar Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hubsmoke there 0-n ResearchComponent per ResearchObject, and an annotation points to a single ResearchComponent. So this field does just the latter: navigation inside that component. Does that make sense?

There is a makeshift type field that I temporarily yanked from nodes, but I agree a generic string field for mimeType makes more sense though. I've been hesitant on this because of the hard-coded alternatives. Feels reasonable for the gateway app to have it's own rules for which subset of mime it consider which views :)

enum ComponentType {
  DATA_BUCKET
  UNKNOWN
  PDF
  CODE
  VIDEO
  DATA
  LINK
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CID is already available as field dagNode on the ResearchComponent, so this path on the annotation would be jsonPath if the mimetype is JSON, page:coordinates or smt if it's a pdf, et cetera :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the component type to mimeType in the PR as well :)

@m0ar m0ar merged commit eead405 into main Oct 9, 2023
@m0ar m0ar deleted the m0ar/annotations branch October 9, 2023 13:25
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

Successfully merging this pull request may close these issues.

2 participants