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

Let Annotations be schema:Things #86

Closed
musicog opened this issue Feb 20, 2020 · 5 comments
Closed

Let Annotations be schema:Things #86

musicog opened this issue Feb 20, 2020 · 5 comments
Assignees

Comments

@musicog
Copy link
Member

musicog commented Feb 20, 2020

As discussed with @alastair, model TROMPA Web Annotations as Things (as well as Annotations), probably using additionalType, so that we can store them within ItemLists

@alastair
Copy link
Member

alastair commented Mar 3, 2020

@musicog can you explain a bit more detail how additionalType may work?
At the moment when we render an item to json-ld, its type is that which is defined a the top of the schema file.
For example, a DigitalDocument is defined as being both a Thing and a CreativeWork:
https://github.com/trompamusic/ce-api/blob/staging/src/schema/type/DigitalDocument.graphql

We've not been mandating that these items also have the additionalType field filled (as a single item, as a list?). In this case, is it mandatory that we add both schema.org/Thing and schema.org/CreativeWork to the additionalType field when rendering to json-ld? Where should this be done? Should it be done only in the json-ld renderer? Should we require that this field is always set in mutations? Can we automatically fill it in somehow using the graphql-neo4j bindings that we use?

@musicog
Copy link
Member Author

musicog commented Mar 3, 2020

Your example specifically does not require additionalTypes to be specified since schema:DigitalDocuments are rdfs:subClassOf schema:CreativeWork (which are in turn rdfs:subClassOf schema:Thing) -- see https://schema.org/DigitalDocument.ttl and https://schema.org/CreativeWork.ttl

However, oa:Annotations are not rdfs:subClassOf schema:Thing, since schema.org and the Web Annotations Data Model are not (explicitly, formally) interlinked. Hence why we need to take the trouble to specify the additionalType.

In other words, a web client application that cares about semantics ought to expect schema:DigitalDocuments to be specialisations of schema:Things, but it's unfair to expect them to know that oa:Annotations are schema:Things without the additional prompt.

As to how to render this in json-ld, my first instinct would be to append the type and any additionalTypes of any given node into the "@type" field of the json-ld output - always producing a list, even if it's a list of one item. Unless you foresee a case where we have to retain the separation of "type" and "additionalType" in the JSON-LD, in which case we could directly incorporate the schema:additionalType property into the JSON-LD output. I suspect the former would produce more useful data.

@alastair
Copy link
Member

alastair commented Mar 4, 2020

Thanks for the explanation. This distinction is clear to me now.
It'd be nice to make this happen automatically when we create an Annotation using the APi.
@ChristiaanScheermeijer, do you know if it's possible to add some additional logic only to CreateAnnotation so that we automatically fill in a field if it's not provided by the user?

@alastair
Copy link
Member

alastair commented Mar 4, 2020

related: #85

@alastair
Copy link
Member

I made annotations schema:Things in #100

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants