Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Feature: web annotations #38

Closed
wants to merge 2 commits into from
Closed

Feature: web annotations #38

wants to merge 2 commits into from

Conversation

alastair
Copy link
Member

This is based on the work that @musicog and I did getting the annotations demo for the music scholars use-case.
The plan is to use this work to make a generic annotations storage system that can be used by all use-cases.
Work-in-progress for now

@alastair
Copy link
Member Author

One thing that we have to look at in further detail is how to handle relationships that can refer to either an item that already exists in the CE, or to an external item.
For a CE item it would be preferable to include a proper relationship, however an external item can only be a string/URL. This means that we potentially need to list 2 fields in the model for some items (such as target). Then we would have to work out the best way to represent this, both in the graphql output and the jsonld output. Currently the jsonld transformer cannot handle this situation.
I'm not sure how to handle the cases where there might be items in these 2 lists where the order of these items is important.


"http://www.w3.org/ns/oa#Annotation"
type Annotation {
# TODO: This should be a UUID or a URL, is there a type that can be used?
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • I think this should be a relationship in the CE, which we can translate to a URL in the JSON-LD output. Otherwise, we can't search by target or show metadata from the target object. If it is an external resource, shouldn't it be added in the CE anyway?
  • Are multiple targets allowed? e.g. target: [URL] VS target: URL

Copy link
Member

Choose a reason for hiding this comment

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

Ideally it should support both (internal) CE identifiers and (external) URIs. If this cannot be implemented due to graphql or neo4j limitations, we could indeed build a service that generates thin wrappers (probably DigitalDocuments) corresponding to external resources. I suspect this could become part of the client-side annotation code...

Multiple targets must be supported. One option to simplify things is to always return a list of targets, even where there is only 1 member.

Empty lists (0 targets) are not allowed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that Christiaan makes a good point here - we don't have to follow the ontology definition in the graphql interface as tightly as I have here. We could have something like an interface to define an AnnotationTarget, which is a union that can be either a link to a thing in the CE, or an external URL (e.g. like a join table in sql). The jsonld generator can then take this and format it correctly. We can also use a similar technique in motivatedBy (a standard web annotations motivation, or a custom one that we create) and body (a link to a textualbody or a URL to an external body).
My original idea was to make as few changes as possible to the jsonld converter, but it seems likely that we'll need to have specific converter modules for specific data types. I'll re-think this architecture.

Comment on lines +30 to +35
# TODO: Motivation can also be defined by us, therefore should also be an ID/UUID
# TODO: in GraphQL, how do you allow this to be either an enum or a string?
# We want the output of this to be a URI of the motivation, so we just set it to
# a [URI] for now so that we output the URI instead of the enum name
"http://www.w3.org/ns/oa#Motivation"
motivation: [URL]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Motivation is the type, not the property of Annotation right?

https://www.w3.org/TR/annotation-vocab/#motivatedby

Copy link
Member

Choose a reason for hiding this comment

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

Indeed.

http://www.w3.org/ns/oa#Motivation is the type
http://www.w3.org/ns/oa#motivatedBy is the property (predicate)

@ChristiaanScheermeijer
Copy link
Collaborator

Hi @alastair, what is the current status of this pull request?

@alastair
Copy link
Member Author

alastair commented Jan 7, 2020

This week I'm going to finish collecting additional requirements for other use-cases. I hope to have it mostly finished by the meeting on the 20th.

@ChristiaanScheermeijer
Copy link
Collaborator

Cool, we are going to make a few changes in the upcoming weeks. Although, I don't think this will collide with this pr.

@alastair
Copy link
Member Author

alastair commented Jan 7, 2020

I'm happy to work around any of your changes if needed 👍

@alastair
Copy link
Member Author

Replaced by #100

@alastair alastair closed this Mar 11, 2020
@alastair alastair deleted the feat/annotations branch March 11, 2020 16:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants