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

feat(schema): Add DefinedTermSet and DefinedTerm #90

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

alastair
Copy link
Member

@alastair alastair commented Feb 26, 2020

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.

A specialised case of ItemList/ListItem for defining terms
#################################
### ThingInterface properties ###
"https://schema.org/additionalType"
additionalType: [String]
Copy link
Member Author

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]
Copy link
Member Author

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")
Copy link
Member Author

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

Copy link
Collaborator

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.

Copy link
Member Author

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 :)

#92

Copy link
Collaborator

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 😄

@ChristiaanScheermeijer
Copy link
Collaborator

The PR looks good to me. Do you want to wait until the comments are resolved?

@alastair
Copy link
Member Author

Thanks! I think we resolved all comments. Pending items have been moved to new issues

Copy link
Collaborator

@ChristiaanScheermeijer ChristiaanScheermeijer left a comment

Choose a reason for hiding this comment

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

In that case 👍

@alastair alastair merged commit b7c7549 into staging Feb 26, 2020
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"
Copy link
Member Author

@alastair alastair Feb 26, 2020

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
Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

See #96

Copy link
Member Author

Choose a reason for hiding this comment

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

@alastair alastair deleted the feat/definedterm branch February 26, 2020 16:25
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.

add DefinedTermSet and DefinedTerm
3 participants