Skip to content

Commit

Permalink
feat: Add Periodical, PublicationIssue and PublicationVolume schema
Browse files Browse the repository at this point in the history
  • Loading branch information
beneboy committed Jul 31, 2019
1 parent 1b234f5 commit 4c2e574
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/writing-schema-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Where possible we use terms from existing vocabularies. Currently, the Stencila
- `bioschemas`: http://bioschemas.org
- `codemeta`: https://doi.org/10.5063/schema/codemeta-2.0


### Type `@id`s

You MUST declare the `@id` keyword for each type using the format `<context>:<type>`. Note that because this property name begins with the special character `@`, that it needs to be surrounded by quotes e.g.
Expand Down Expand Up @@ -56,20 +55,19 @@ By declaring the `@id` of that property as `schema:givenName` we are saying "wit

Sometimes, a property name is not represented in another vocabulary. In these casese, define the property name as a new term within the Stencila vocabulary i.e. `'@id': stencila:<property>`


## The `extends` keyword

This is a custom keyword which allows your type schema to inherit the `properties` and `required` keywords of a parent type schema. It should be the name of another type e.g.

```yaml
extends: Thing
extends: Entity
```

## The `role` keyword

A RECOMMENDED custom keyword to indicate the role of the type schema:

- `base`: base types, not usually instantiated but required for other types e.g `Thing`
- `base`: base types, not usually instantiated but required for other types e.g `Entity` or `Thing`
- `primary`: types that are usually the root of a tree generated from a file e.g. `Article`, `Datatable`, `Collection`
- `secondary`: types usually only referred to by primary types e.g. `Organization` is used for the `publisher` property on a `Article`
- `tertiary`: types usually only referred to by secondary types e.g. `ContactPoint` is used for the `contactPoints` property on an `Organization`
Expand Down
31 changes: 31 additions & 0 deletions schema/Periodical.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
title: Periodical
'@id': stencila:Periodical
extends: CreativeWork
role: secondary
status: experimental
description: A periodical publication.
properties:
dateStart:
'@id': schema:startDate
description: The date this Periodical was first publilshed.
type: string
anyOf:
- type: string
format: date
- type: string
format: date-time
dateEnd:
'@id': schema:endDate
description: The date this Periodical ceased publication.
type: string
anyOf:
- type: string
format: date
- type: string
format: date-time
issn:
'@id': schema:issn
description: The International Standard Serial Number (ISSN) that identifies this serial publication.
type: array
items:
- type: string
31 changes: 31 additions & 0 deletions schema/PublicationIssue.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
title: PublicationIssue
'@id': stencila:PublilcationIssue
extends: CreativeWork
role: secondary
status: experimental
description: |
A part of a successively published publication such as a periodical or publication volume, often numbered.
properties:
issueNumber:
'@id': schema:issueNumber
description: Identifies the issue of publication; for example, "iii" or "2".
anyOf:
- type: string
- type: integer
pageStart:
'@id': schema:pageStart
description: The page on which the work starts; for example "135" or "xiii".
anyOf:
- type: string
- type: integer
pageEnd:
'@id': schema:pageEnd
description: The page on which the work ends; for example "138" or "xvi".
anyOf:
- type: string
- type: integer
pagination:
'@id': schema:pagination
description: |
Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".
type: string
31 changes: 31 additions & 0 deletions schema/PublicationVolume.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
title: PublicationVolume
'@id': stencila:PubllicationVolume
extends: CreativeWork
role: secondary
description: |
A part of a successively published publication such as a periodical or multi-volume work.
properties:
pageStart:
'@id': schema:pageStart
description: The page on which the work starts; for example "135" or "xiii".
anyOf:
- type: string
- type: integer
pageEnd:
'@id': schema:pageEnd
description: The page on which the work ends; for example "138" or "xvi".
anyOf:
- type: string
- type: integer
pagination:
'@id': schema:pagination
description: |
Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".
type: string
volumeNumber:
'@id': schema:volumeNumber
description: |
Identifies the volume of publication or multi-part work; for example, "iii" or "2".
anyOf:
- type: string
- type: integer

0 comments on commit 4c2e574

Please sign in to comment.