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

feat(schema): Allow custom motivations to be created #172

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions src/schema/type/Annotation.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,35 @@ type AnnotationTextualBody {
modified: _Neo4jDateTime
}

"http://www.w3.org/ns/oa#Motivation"
type AnnotationCEMotivation {
"http://purl.org/dc/terms/identifier,https://schema.org/identifier"
identifier: ID @id
"http://purl.org/dc/terms/contributor,https://schema.org/contributor"
creator: String
"http://purl.org/dc/terms/description,https://schema.org/description"
description: String
"http://purl.org/dc/terms/title"
title: String
"http://purl.org/dc/terms/created"
created: _Neo4jDateTime
"http://purl.org/dc/terms/modified"
modified: _Neo4jDateTime

#######################
### SKOS properties ###
# A motivation SHOULD list skos:broader, which defines the motivation of which
# this term is a more specific version. If this Motivation has a standard motivation
# as its broader value, set an enum in broaderMotivation.
# If it's a third party URL, use broaderUrl.
"http://www.w3.org/2004/02/skos/core#broader"
broaderUrl: String
"http://www.w3.org/2004/02/skos/core#broader"
broaderMotivation: AnnotationMotivation
}

"http://www.w3.org/ns/oa#Annotation"
type Annotation implements ThingInterface {
type Annotation implements ThingInterface & ProvenanceEntityInterface {
#############################
### Annotation properties ###
"http://purl.org/dc/elements/1.1/identifier,https://schema.org/identifier"
Expand All @@ -59,11 +86,13 @@ type Annotation implements ThingInterface {
motivationDefinedTerm: DefinedTerm @relation(name: "ANNOTATON_MOTIVATION_DEFINED_TERM", direction: OUT)
"http://www.w3.org/ns/oa#Motivation"
motivation: AnnotationMotivation!
motivationUrl: [String]
motivationNode: [AnnotationCEMotivation] @relation(name: "ANNOTATION_MOTIVATION_NODE", direction: OUT)
# An annotation can have multiple bodies, or none
"A textual body node"
bodyText: [AnnotationTextualBody] @relation(name: "ANNOTATION_BODY_TEXT", direction: OUT)
"A body which is a URL to an external resource"
bodyUrl: [String],
bodyUrl: [String]
"A body which represents a node in the CE [will be rendered in the same way as bodyUrl]"
bodyNode: [ThingInterface] @relation(name: "ANNOTATION_BODY_NODE", direction: OUT)

Expand Down Expand Up @@ -126,4 +155,15 @@ type Annotation implements ThingInterface {
created: _Neo4jDateTime
"http://purl.org/dc/terms/modified"
modified: _Neo4jDateTime

############################################
### ProvenanceEntityInterface properties ###
"http://www.w3.org/ns/prov#wasGeneratedBy"
wasGeneratedBy: [ActionInterface] @relation(name: "WAS_GENERATED_BY", direction: OUT)
"http://www.w3.org/ns/prov#wasDerivedFrom"
wasDerivedFrom: [ThingInterface] @relation(name: "WAS_DERIVED_FROM", direction: OUT)
"http://www.w3.org/ns/prov#wasAttributedTo"
wasAttributedTo: [AgentInterface] @relation(name: "WAS_ATTRIBUTED_TO", direction: OUT)
"http://www.w3.org/ns/prov#used"
used: [ThingInterface] @relation(name: "USED", direction: OUT)
}
8 changes: 6 additions & 2 deletions src/schema/type/DefinedTerm.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ type DefinedTerm implements ThingInterface {

#######################
### SKOS properties ###
# When we use a DefinedTerm to refer to an annotation motivation, we have to add the movitavtion
# When we use a DefinedTerm to refer to an annotation motivation, we have to add the motivation
# of which this term is a more specific version of to skos:broader. If you do this, you should
# also add http://www.w3.org/ns/oa#Motivation as an additionalType
# If this DefinedTerm has a standard motivations as its broader value, set an enum in
# broaderMotivation. If it's a third party URL, use broaderUrl.
"http://www.w3.org/2004/02/skos/core#broader"
broader: String
broaderUrl: String
"http://www.w3.org/2004/02/skos/core#broader"
broaderMotivation: AnnotationMotivation
}