-
Notifications
You must be signed in to change notification settings - Fork 0
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
type ResearchComponent @loadModel(id: "$RESEARCH_COMPONENT_ID") { | ||
id: ID! | ||
} | ||
|
||
type Claim @loadModel(id: "$CLAIM_ID") { | ||
id: ID! | ||
} | ||
|
||
type Annotation | ||
@createModel(accountRelation: LIST, description: "Research component commentary") | ||
{ | ||
owner: DID! @documentAccount | ||
comment: String! @string(maxLength: 1024) | ||
|
||
componentID: StreamID! @documentReference(model: "ResearchComponent") | ||
component: ResearchComponent! @relationDocument(property: "componentID") | ||
|
||
# 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) | ||
|
||
claimID: StreamID @documentReference(model: "Claim") | ||
claim: Claim @relationDocument(property: "claimID") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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
perResearchObject
, and an annotation points to a singleResearchComponent
. 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 formimeType
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 :)There was a problem hiding this comment.
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 theResearchComponent
, so thispath
on the annotation would bejsonPath
if the mimetype is JSON,page:coordinates
or smt if it's a pdf, et cetera :)There was a problem hiding this comment.
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 :)