Skip to content
Snippets Groups Projects
Commit 56ef53ea authored by Jure's avatar Jure
Browse files

Move comments into GraphQL schema file

parents c352bbcc b09bda74
No related branches found
No related tags found
1 merge request!6Move comments into GraphQL schema file
...@@ -7,136 +7,4 @@ ...@@ -7,136 +7,4 @@
- All models have an 'id' UUID - All models have an 'id' UUID
- Dates are ISO-8601 strings, as PostgreSQL recommends this as date input, JATS allows it, and GraphQL can handle it. - Dates are ISO-8601 strings, as PostgreSQL recommends this as date input, JATS allows it, and GraphQL can handle it.
# Models [Shared data model schema](schema.graphql)
## Organization
| | type | JATS | comment |
|---|---|---|---|
| id | UUID | | |
| created | Date | | |
| updated | Date | | |
| name | String | | |
| journals | [Journal] | | |
## Journal
| | type | JATS | comment |
|---|---|---|---|
| id | UUID | | |
| created | Date | | |
| updated | Date | | |
| journalTitle | String | `<journal-title>` | |
| manuscripts | [Manuscript] | | |
| meta | JournalMetadata | |
| └ meta.publisherName | String | `<publisher-name>` |
## AuditLog
| | type | JATS | comment |
|---|---|---|---|
| id | UUID | | |
| created | Date | | |
| userId | | | |
| action | String | | |
| objectId | | | |
| objectType | | | |
| meta | | | |
## Team
All groups of people should be grouped in Teams. Teams are given permissions to an object. Permissions are based on the role.
| | type | JATS | comment |
|---|---|---|---|
| id | UUID | | |
| created | Date | | |
| updated | Date | | |
| members | [TeamMember] | | |
| &nbsp;&nbsp;└ member.user | User | | |
| &nbsp;&nbsp;└ member.status | String | | |
| &nbsp;&nbsp;└ member.alias | Object | | |
| role | String | | e.g. 'reviewers', 'editors' |
| objectId | | | |
| objectType | | | |
### Roles
#### Default
`'submitter'`,
`'author'`,
`'reviewer'`,
`'admin'`
#### Specialized examples
`'deputyEditor'`, `'handlingEditor'`, `'seniorEditor'`, `'suggestedReviewer'`, `'opposedReviewer'`
## User
| | type | JATS | comment |
|---|---|---|---|
| id | UUID | | |
| created | Date | | |
| updated | Date | | |
| identities | | | |
| &nbsp;&nbsp;└ local | | | local identity (not from ORCID, etc.)|
| &nbsp;&nbsp;&nbsp;&nbsp;└ local.email | String | | |
| &nbsp;&nbsp;&nbsp;&nbsp;└ local.password | Hash | | |
| &nbsp;&nbsp;&nbsp;&nbsp;└ local.name | String or Object| | |
| &nbsp;&nbsp;&nbsp;&nbsp;└ local.[] | | | Profile extensions |
| &nbsp;&nbsp;└ [] | | | other identities|
| defaultIdentity | | | Ex. 'local' |
## Manuscript
| | type | JATS | comment |
|---|---|---|---|
| id | UUID | | |
| created | Date | | |
| updated | Date | | |
| manuscriptVersions | [ManuscriptVersion] | | |
| files | [File] | `<graphic>`, `<media>`,`<supplementary-material>` | |
| teams | [Team] | | |
| reviews | [Review] | | |
| status | String | | e.g. `initial` or `QA` |
| formState | String | | persists serialized form state as JSON |
| decision | String | | |
| meta | ManuscriptMetadata | | |
| └ meta.articleType | String | `@article-type` | |
| └ meta.notes | [Note] | `<notes>` | |
| &nbsp;&nbsp;└ note.notesType | String | `@notes-type` | |
| &nbsp;&nbsp;└ note.content | String | | |
| └ meta.articleIds | [ArticleId] | `<article-id>` | |
| &nbsp;&nbsp;└ articleId.pubIdType | String | `@pub-id-type` | doi, pmid, etc. |
| &nbsp;&nbsp;└ articleId.id | String | | |
| └ meta.title | String | `<title>` | |
| └ meta.abstract | String | `<abstract>` | |
| └ meta.subjects | [String] | `<subject>` | |
| └meta.history | [MetaDate] | `<history><date>`| |
| &nbsp;&nbsp;&nbsp;metaDate.type | String | `@date-type`| epub, ppub, etc. |
| &nbsp;&nbsp;&nbsp;metaDate.date | Date | `@iso-8601-date` | epub, ppub, etc. |
| └meta.publicationDates | [MetaDate] | `<pub-date>`| |
| &nbsp;&nbsp;&nbsp;metaDate.type | String | `@pub-type`| epub, ppub, etc. |
| &nbsp;&nbsp;&nbsp;metaDate.date | Date | `@iso-8601-date`| date |
## ManuscriptVersion
Manuscript version is a snapshot copy of a manuscript, whenever the manuscript is changed in such a way that a new version should be created and the previous recorded as history.
## File
| | type | JATS | comment |
|---|---|---|---|
| id | UUID | | |
| created | Date | | |
| updated | Date | | |
| type | String | `<fig>`, `<supplementary-material>`, `<table-wrap>` | e.g. 'figure', 'supplementary', 'table' |
| label | String | `<label>` | e.g. 'F1', 'Fig 1', 'S1' |
| filename | String | `<media>`, `<graphic>` | |
| url | String | `@xlink:href` | |
| mimeType | String | `@mime-type`, `@mime-subtype` | e.g. 'image/jpeg', 'application/zip' |
| size | Number | | |
## Review
| | type | JATS | comment |
|---|---|---|---|
| id | UUID | | |
| created | Date | | |
| updated | Date | | |
| comments | [Comment] | | |
| &nbsp;&nbsp;└ comment.type | String | | |
| &nbsp;&nbsp;└ comment.content | String | | |
| &nbsp;&nbsp;└ files | [File] | | |
| recommendation | String| | |
| open | Boolean | | |
| user | | | |
...@@ -16,13 +16,13 @@ type Journal implements Object { ...@@ -16,13 +16,13 @@ type Journal implements Object {
id: ID! id: ID!
created: DateTime! created: DateTime!
updated: DateTime updated: DateTime
journalTitle: String! journalTitle: String! # JATS <journal-title>
manuscripts: [Manuscript] manuscripts: [Manuscript]
meta: JournalMeta meta: JournalMeta
} }
type JournalMeta { type JournalMeta {
publisherName: String publisherName: String # JATS <publisher-name>
} }
type Manuscript implements Object { type Manuscript implements Object {
...@@ -30,15 +30,17 @@ type Manuscript implements Object { ...@@ -30,15 +30,17 @@ type Manuscript implements Object {
created: DateTime! created: DateTime!
updated: DateTime updated: DateTime
manuscriptVersions: [ManuscriptVersion] manuscriptVersions: [ManuscriptVersion]
files: [File] files: [File] # JATS <graphic>, <media>, <supplementary-material>
teams: [Team] teams: [Team]
reviews: [Review] reviews: [Review]
status: String status: String # e.g. 'initial', 'QA'
formState: String formState: String # persists serialized form state as JSON
decision: String decision: String
meta: ManuscriptMeta meta: ManuscriptMeta
} }
# Manuscript version is a snapshot copy of a manuscript, whenever the manuscript is changed
# in such a way that a new version should be created and the previous recorded as history.
type ManuscriptVersion implements Object { type ManuscriptVersion implements Object {
id: ID! id: ID!
created: DateTime! created: DateTime!
...@@ -53,31 +55,31 @@ type ManuscriptVersion implements Object { ...@@ -53,31 +55,31 @@ type ManuscriptVersion implements Object {
} }
type ManuscriptMeta { type ManuscriptMeta {
title: String! title: String! # JATS <title>
articleType: String articleType: String # JATS @article-type
articleIds: [ArticleId] articleIds: [ArticleId] # JATS <article-id>
abstract: String abstract: String # JATS <abstract>
subjects: [String] subjects: [String] # JATS <subject>
history: [MetaDate] history: [MetaDate] # JATS <history><date>
publicationDates: [MetaDate] publicationDates: [MetaDate] # JATS <pub-date>
notes: [Note] notes: [Note] # JATS <notes>
} }
type ArticleId { type ArticleId {
pubIdType: String pubIdType: String # JATS @pub-id-type
id: String id: String
} }
type MetaDate { type MetaDate {
type: String type: String # JATS @date-type e.g. 'epub' or 'submitted'
date: DateTime date: DateTime # JATS @iso-8601-date
} }
type Note implements Object { type Note implements Object {
id: ID! id: ID!
created: DateTime! created: DateTime!
updated: DateTime updated: DateTime
notesType: String notesType: String # JATS @notes-type
content: String content: String
} }
...@@ -85,11 +87,11 @@ type File implements Object { ...@@ -85,11 +87,11 @@ type File implements Object {
id: ID! id: ID!
created: DateTime! created: DateTime!
updated: DateTime updated: DateTime
type: String type: String # JATS <fig>, <supplementary-material>, <table-wrap> e.g. 'figure', 'supplementary', 'table'
label: String label: String # JATS <label> e.g. 'Fig 1', 'S1'
filename: String filename: String # JATS <media>, <graphic> e.g. 'figure1.png'
url: String url: String # JATS @xlink:href
mimeType: String mimeType: String # JATS @mime-type e.g. 'image/png'
size: Int size: Int
} }
...@@ -119,15 +121,20 @@ type AuditLog { ...@@ -119,15 +121,20 @@ type AuditLog {
objectType: String objectType: String
} }
# All groups of people should be grouped in Teams.
# Teams are given permissions to an object.
# Permissions are based on the role.
type Team { type Team {
id: ID! id: ID!
created: DateTime! created: DateTime!
updated: DateTime updated: DateTime
members: [TeamMember] members: [TeamMember]
role: String role: String # e.g. author, seniorEditor, suggestedReviewer
object: Object object: Object
objectType: String objectType: String
} }
# Default roles 'submitter', 'author', 'reviewer', 'admin'
# Specialized roles 'deputyEditor', 'handlingEditor', 'seniorEditor', 'suggestedReviewer', 'opposedReviewer'
type TeamMember { type TeamMember {
user: User user: User
...@@ -138,7 +145,7 @@ type TeamMember { ...@@ -138,7 +145,7 @@ type TeamMember {
type Alias { type Alias {
name: Name name: Name
email: Email email: Email
aff: String aff: String # JATS <aff>
} }
type User { type User {
...@@ -146,21 +153,22 @@ type User { ...@@ -146,21 +153,22 @@ type User {
created: DateTime! created: DateTime!
updated: DateTime updated: DateTime
identities: [Identity] identities: [Identity]
defaultIdentity: String defaultIdentity: String # e.g. local
} }
union Identity = Local | External union Identity = Local | External
# local identity (not from ORCID, etc.)
type Local { type Local {
name: Name name: Name
email: Email email: Email
aff: String aff: String # JATS <aff>
} }
type External { type External {
identifier: String identifier: String
email: Email email: Email
aff: String aff: String # JATS <aff>
} }
type Name { type Name {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment