-
Notifications
You must be signed in to change notification settings - Fork 1
feat(schema): Add DefinedTermSet and DefinedTerm #90
Conversation
A specialised case of ItemList/ListItem for defining terms
################################# | ||
### ThingInterface properties ### | ||
"https://schema.org/additionalType" | ||
additionalType: [String] |
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.
By convention, @musicog and I decided that this field will be "https://vocab.trompamusic.eu/vocab#TagCollectionElement" for items which refer to a set of tags used in an annotation. We'll make sure to add this to the documentation for annotations
################################# | ||
### ThingInterface properties ### | ||
"https://schema.org/additionalType" | ||
additionalType: [String] |
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.
# TODO: inDefinedTermSet can also be a URL, is this needed in the CE? | ||
# TODO: This should only be a relation to one DefinedTermSet | ||
"https://pending.schema.org/inDefinedTermSet" | ||
inDefinedTermSet: [DefinedTermSet] @relation(name: "HAS_DEFINED_TERM", direction: "IN") |
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.
In a database, I'd model this as a one-to-many relation. A term can belong to only one term set. A term set can contain many terms. I don't know how to model this with the neo4j-graphql library, and so it's currently a many-to-many, though this is wrong. Any suggestions on how to make this better would be appreciated
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.
Yes, I've also encountered this problem for the EntryPoint#potentialAction
property. The same ControlAction
can be linked multiple times to the same EntryPoint. Unfortunately, there is no easy solution with the neo4j-graphql-js
library.
Neo4j constraints could be the answer to this problem.
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.
In the case of a neo4j constraint we would have to see what the error-case is if you try and add more than one item here. Will it be a regular graphql data error, or will the server crash :)
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.
That is a good question indeed 😄
The PR looks good to me. Do you want to wait until the comments are resolved? |
Thanks! I think we resolved all comments. Pending items have been moved to new issues |
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.
In that case 👍
title: String | ||
"http://purl.org/dc/elements/1.1/type,https://www.w3.org/2000/01/rdf-schema#type" | ||
type: String | ||
"http://purl.org/dc/elements/1.1/date" |
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.
this is wrong. should be http://purl.org/dc/terms/created. Will update. Consider making neo4jdatetime
"http://purl.org/dc/elements/1.1/date" | ||
created: String | ||
"http://purl.org/dc/elements/1.1/date" | ||
updated: String |
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.
there's no 'updated' field in dcterms, nor can I find one in schema.org. Is there any field defined for when an item was updated? If not, do we want to track if an item is updated? Does it make sense to track this?
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.
See #96
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.
Fixes #88
As part of the development of the Annotation schema, we realised that we needed a way of creating a closed vocabulary of terms that could be used in an annotation, for example if someone wants to annotate a performance as one of (excellent, good, needs work).
@musicog found the DefinedTerm specification, which is currently on pending.schema.org, but fulfils our requirements.
Add to the schema the ability to create a DefinedTermSet, and add DefinedTerms to it.